package com.gmail.avereshchaga.db.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author <a href="mailto:avereshchaga@gmail.com">Vereshchaga Alexey</a>
 */
@Entity
@Table(name = "users_session_id")
public class UserSessionIdImpl implements IUserSessionId {

    @Id
    @SequenceGenerator(name = "id", sequenceName = "user_session_id ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "id")
    @Column(name = "id", insertable = false, updatable = false)
    private Long id;
    @ManyToOne(targetEntity = UserImpl.class)
    @JoinColumn(name = "user_id")
    private IUser user;
    @Column(name = "session_id")
    private Long sessionId;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public IUser getUser() {
        return user;
    }

    @Override
    public void setUser(IUser user) {
        this.user = user;
    }

    @Override
    public Long getSessionID() {
        return sessionId;
    }

    @Override
    public void setSessionId(Long sessionID) {
        this.sessionId = sessionID;
    }
}
